package com.jdrx.sw.sewage.dao;

import com.jdrx.sw.sewage.beans.anno.MapF2F;
import com.jdrx.sw.sewage.beans.dto.JCWaterDTO;
import com.jdrx.sw.sewage.beans.dto.ManyDataThresholdDTO;
import com.jdrx.sw.sewage.beans.dto.StationIdDTO;
import com.jdrx.sw.sewage.beans.entity.AiModelParamPO;
import com.jdrx.sw.sewage.beans.entity.GatherDevPointPO;
import com.jdrx.sw.sewage.beans.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * 站点的设备点位DAO（sewage_station_device_point）
 * Created by generator on 2020-10-12.
 */
@Mapper
public interface GatherDevPointDAO {

    List<ManyDataThresholdVO> selectManyDataThreshold(StationIdDTO dto);

    int deleteByPrimaryKey(Long id);

    int insert(GatherDevPointPO record);

    int insertSelective(GatherDevPointPO record);

    GatherDevPointPO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(GatherDevPointPO record);

    int updateByPrimaryKey(GatherDevPointPO record);

    List<GatherDevPointVO> selectPointValueAndStationId(String key);

    int batchUpdateByGatherDevPoiId(Map<String, Object> params);

    int updateByGatherDevPoiId(@Param("gatherDevPointId") Long gatherDevPointId,
                               @Param("parValue") Double parValue);

    GatherDevPointPO selectBusIdAndva(@Param("stationId") Long stationId,
                                      @Param("value") String value);

    void update(GatherDevPointPO gatherDevPointPO);

    Integer selectAlarm(@Param("alarmStatus") Integer alarmStatus,
                        @Param("processunitId") Long processunitId);

    List<Integer> selectFactoryPeriodList(List<Long> dutyUserStationIds);

    List<ProcessunitFPVO> findProcUByStationId(StationIdDTO dto);

    List<DeviceDateDisplayVO> findInQualityByStationId(JCWaterDTO dto);

    List<MedicinePointOptionVO> options();

    Double selectCurrOutWater(@Param("stationId") Long stationId,
                              @Param("gValue") String gValue);

    void updateByStationIdAndIotGateway(@Param("stationId") Long stationId,
                                        @Param("netNum") String netNum);

    List<GatherDevPointOptionVO> findByValues(@Param("values") List<String> values);

    List<String> findWaterQualityPoi(@Param("dataNode") String dataNode,
                                     @Param("iotGatewayNum") String iotGatewayNum);

    Long findIdByValue(@Param("value") String value);

    void updateManyDataThreshold(List<ManyDataThresholdDTO> list);

    List<String> selectWaterQualityPoint(StationIdDTO dto);

    @MapF2F(isAllowKeyRepeat = true)
    Map<String, Double> findByValueAndVal(@Param("aiModelParamPOs") List<AiModelParamPO> aiModelParamPOs);

    @MapF2F(isAllowKeyRepeat = true)
    Map<String, Double> findByModePrCode(@Param("parentName") String parentName);
}